import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/home",
      name: "home",
      component: HomeView,
    },
    {
      path: "/about",
      name: "about",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/AboutView.vue"),
    },
    {
      path: "/",
      name: "Login",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/Login.vue"),
    },
    {
      path: "/Main",
      name: "Main",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/Main.vue"),
      children: [
        {
          path: "/Show",
          name: "Show",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/RBAC/Show.vue"),
        },
        {
          path: "/RoleShow",
          name: "RoleShow",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/RBAC/RoleShow.vue"),
        },
        {
          path: "/MenuShow",
          name: "MenuShow",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/RBAC/MenuShow.vue"),
        },
        {
          path: "/RoleMenuShow",
          name: "RoleMenuShow",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/RBAC/RoleMenuShow.vue"),
        },
        {
          path: "/LeaveShow",
          name: "LeaveShow",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/RBAC/LeaveShow.vue"),
        },
        {
          path: "/ReportShow",
          name: "ReportShow",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/RBAC/ReportShow.vue"),
        },
        {
          path: "/Traceability",
          name: "Traceability",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/TraceabilityApp/Traceability.vue"),
        },
        {
          path: "/Details",
          name: "Details",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/TraceabilityApp/Details.vue"),
        },
    {
          path: "/WinFrom",
          name: "WinFrom",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("../views/WinFrom.vue"),
        },
      ],

    },

  ],

});

export default router;
